import request from '@/utils/request'

const userApi = {
  Login: '/v1/account/login',
  Logout: '/v1/auth/logout',
  ForgePassword: '/v1/account/forgetPassword',
  UpdatePassword: '/v1/account/updatePassword',
  Register: '/v1/auth/register',
  SendEmail: '/v1/account/mail',
  UserInfo: '/v1/auth/info',
}

/**
 * login func
 * @param parameter
 * @returns {*}
 */
export function login (parameter) {
  return request({
    url: userApi.Login,
    method: 'post',
    data: parameter
  })
}

export function logout () {
  return request({
    url: userApi.Logout,
    method: 'post',
  })
}

export function getSmsCaptcha (parameter) {
  return request({
    url: userApi.SendEmail,
    method: 'post',
    data: parameter
  })
}

export function getInfo () {
  return request({
    url: userApi.UserInfo,
    method: 'get',
  })
}

